package str

import "fmt"

func FindRepeatedDnaSequences(s string) []string {
	DnaLen := 10
	DnaMap := map[string]int{}
	res := []string{}

	for i := 0; i < len(s)-DnaLen+1; i++ {
		temp := s[i : i+DnaLen]
		if v, ok := DnaMap[temp]; ok && v == 1 {
			DnaMap[temp]++
			fmt.Println(i, temp)
			res = append(res, temp)
		} else if !ok {
			DnaMap[temp] = 1
		}
	}

	return res

}
